﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Ovvio.Web.Areas.Admin.Models.RatingModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Ratings
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.Telerik().Grid(Model)
        .Name("RatingsGrid")
        .ToolBar(toolbar => toolbar.Insert().ButtonType(GridButtonType.BareImage))
        .DataKeys(keys => { keys.Add(p => p.Id).RouteKey("Id"); })
        .Sortable()
        .Scrollable(scroll => scroll.Height(320))
        .DataBinding(dataBinding => dataBinding.Server()
            .Insert("Create", "Ratings", new { mode = GridEditMode.PopUp, type = GridButtonType.BareImage })
            .Update("Update", "Ratings", new { mode = GridEditMode.PopUp, type = GridButtonType.BareImage })
            .Delete("Delete", "Ratings", new { mode = GridEditMode.PopUp, type = GridButtonType.BareImage })
            )
        .Columns(columns =>
        {
            columns.Bound(o => o.Value);
            columns.Bound(o => o.Description);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.BareImage);
                commands.Delete().ButtonType(GridButtonType.BareImage);
            });
        })
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .Render();
    %>
    <%--<%= Html.ActionLink("New Rating Entry", "Create") %>
    <table>
        <tr>
          
            <th>
                Rating
            </th>
            <th>
                Description
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.Value) %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
             <td>
                <%= Html.ActionLink("Edit", "Edit", new { id = item.Id /* id=item.PrimaryKey */ }) %> |
                <%= Html.ActionLink("Details", "Details", new { id = item.Id /* id=item.PrimaryKey */ })%> |
                <%= Html.ActionLink("Delete", "Delete", new { id = item.Id /* id=item.PrimaryKey */ })%>
            </td>
        </tr>
    
    <% } %>

    </table>--%>

    

</asp:Content>

